package me.zk.practice1.s;

/**
 * @author zhangkai
 * @date 2023/7/13 09:58
 */
public class LS_Offer_05 {
    public String replaceSpace(String s) {
      StringBuilder sb = new StringBuilder();
      char[] chars = s.toCharArray();
        for (char aChar : chars) {
            if (aChar == ' ') {
                sb.append("%20");
            } else {
                sb.append(aChar);
            }

        }
        return sb.toString();
    }
}
